<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
     <!-- 1. 引入react核心库 -->
     <script src="./node_modules/react/umd/react.development.js"></script>
     <!-- 2. 引入react-dom 用于支持react操作dom -->
     <script src="./node_modules/react-dom/umd/react-dom.development.js"></script>
     <div id="box"></div>
     <script>
        let title = React.createElement('h2', null, '你好React')
       // 4. 渲染元素到页面中
       // 17版本用法
    //    ReactDOM.render(title, document.getElementById('root'))
       // 18用法
       // 创建根节点 
       let root = ReactDOM.createRoot(document.getElementById('box'))
       // 渲染元素到页面中
       root.render(title)

        // 虚拟dom->普通对象
        console.log('VDOM',title);
        console.log('TDOM',document.getElementById('box'));

        let TDOM=document.getElementById('box')
        // 判断数据的类型 typeof instanof
        let arr=[]
        console.log('title-typeof',typeof title,typeof arr); //Object
        console.log('title-instanceof',title instanceof Object);
        console.log('arr-instanceof',arr instanceof Object && arr instanceof Array);
     </script>
</head>
<body>
    
</body>
</html>